package org.ewancle.springbootelasticsearch.service;

import org.ewancle.springbootelasticsearch.model.Document;

import java.io.IOException;
import java.util.List;
import java.util.Map;


public interface ElasticsearchService {
    // 创建或更新文档
    String indexDocument(Document document) throws IOException;

    // 根据ID获取文档
    Document getDocumentById(String id) throws IOException;

    // 删除文档
    boolean deleteDocument(String id) throws IOException;

    // 搜索文档
    List<Document> searchDocuments(String field, String query) throws IOException;

    // 高级搜索
    List<Document> advancedSearch(Map<String, Object> searchCriteria, int from, int size) throws IOException;

    // 批量操作
    void bulkIndex(List<Document> documents) throws IOException;
}
